Circuits
About Circuits are editable networks of Chips, Circuit Boards, Gizmos, other gadgets, and dynamic props that can be used in Custom Rooms to execute more or less complex programs. These programs can control animated and interactive elements of a room, for example, animated or interactive spot lights, sound effects, holotar projections, or complete games. The pages about Chips, Circuit Boards, and Gizmos describe those elements in more detail. The other gadgets and dynamic props are described below. The capability of using a Maker Pen and editing circuits is determined by your Permissions in a room; by default, only creators and co-owners may edit circuits in Custom Rooms. Most elements of circuits are created with the Maker Pen and the "Gadgets" tab of the Palette. The exception are dynamic props, which are available in the "Props" tab of the Palette. Chips, gizmos, and objects can be configured with the Configure mode of the Maker Pen. They can be connected and disconnected with the Wire mode of the Maker Pen – usually by connecting their pins, but Gizmos can also be connected to whole objects. You can get information about most pins (function of input pins and current values of output pins) by pointing with the ray of the Maker Pen (for example in Wire mode) at a pin for about 2 seconds. Circuit nodes (such as chips, gizmos, or other gadgets/props) process their signals about 10 times per second. The system evaluates chips in a particular order, i.e., a chip that produces a signal for another chip is usually evaluated before the other chip is evaluated (except in case of cycles where the evaluation order depends on the order in which the chips were connected). Thus, if there are no cycles, a signal can travel from a chip at one end of a circuit to a chip at another end of the circuit within just 1/10 of a second. This is referred to as a "circuit tick". If you have questions about specific circuits or the system in general, don't hesitate to ask them in the #circuits channel of Against Gravity's discord. Examples of Circuits ] Many examples of useful circuits are documented in Circuit Diagrams. Several players have created YouTube videos about circuits, e.g., Vigorous Rapscallion. Many of these videos have been posted to the #tutorials channel of the Rec Room discord. Against Gravity maintains a support page about creating rooms, which includes circuits. You can see many circuits in Rec Room by going to Custom Rooms like ^CircuitAcademy0, ^CircuitsForDummies, ^circuitdemo, ^circuitrecipes, ^TeamandStatscircuits, ^GameModeCircuits, ^GizmosAndTags, ^DoorGizmos, ^Gizmos2WavesItemspawns, ^TutoNPC, etc. To find these rooms, open your Watch Menu, click on the Play button and then the Search tab. Click on "Enter name here," type in the name, and then click the "Search" button. Data Types Circuit nodes can only exchange integer values with each other, but internally they might use different types. Therefore internal values might have to be converted to and from integers. Integer The native circuit values are 32-bit signed integers: They range from −2,147,483,648 to 2,147,483,647 and cannot produce fractions or real numbers. Boolean Many inputs and outputs use an integer value to represent only two Boolean values, i.e., false (a value equal to 0) and true (any value unequal to 0). For inputs, that means that 0 is interpreted as false, any other value as true. For outputs, that means that 0 is emitted for false and 1 for true. Float Gizmos for example convert their inputs to floats. The value range of floats is larger than that of integers, so you can pass any integer number and it can be used. However the precision of a float depends on how close the number is to 0; the precision falls below 1 outside the range of -16,777,217 to 16,777,216. In other words, you can input and use 16,777,216 just fine, but 16,777,217 will have the exact same result as it is rounded to 16,777,216. ID Some chips use integer IDs as inputs or outputs. Those are numbers that uniquely identify entities: Player ID Every player gets an ID when the player joins the Room, and that ID is valid until the player leaves. Your player ID is equal to your index of joined players in that room, meaning the first player to join gets ID 1, the second gets ID 2, and so on. If a player leaves and rejoins, they are given a completely new Player ID because rejoining is not different from joining. Player IDs only repeat after a Room becomes completely empty (because the room instance stops existing for that time). If a Room stays populated for a long time, with many players leaving and joining (or rejoining), there is no true limit to how large assigned Player ID values can become. For Circuits, a player ID of -1 will apply to all players; this is useful, for example, if you need to set everyone's health. Team ID Every team color has a different ID, ranging from 1 to 16. Team Index When a player joins a team, they are given the lowest currently unused Team Index, starting at 1. Team Indices may be re-used (this is notably different from Player IDs, which always increase in value). When a player leaves a team, their Team Index remains unused until a new player joins and receives it (this means that the range of valid Team Indices can't always be determined from the number of players on that team). Object ID Every object has a unique object ID. These are sent by Trigger Volumes and can be mapped to player IDs with the Object Mapper chip. IDs of objects stay the same until a room is saved or restored, then everything gets new IDs. You can use a Randomiser Chip to store an Object ID, by connecting the Red pin on an Object Trigger to all three pins on the Randomiser. Pitfalls The current version of circuits has some known pitfalls that can be hard to understand if you are not aware of them. Invisible Circuits The capability of using a Maker Pen and viewing gadgets is controlled by Permissions in a room. Thus, if you don't have the Permissions to edit circuits for a particular room, you might have to ask the creator of the room to give you such permissions. Connecting Frozen Objects Wiring frozen objects is currently not possible. You have to unfreeze both objects with the Freeze mode of the Maker Pen before connecting them. It should be noted that frozen objects can still be connected to Gizmos. Connecting Shapes to Gizmos You cannot connect Maker Pen shapes to Gizmos, but you can connect Maker Pen objects to Gizmos. To turn a shape into an object, press the "Done Editing" button of the Maker Pen. Value Range Circuits currently support only 32-bit signed integers as signals. They range from −2,147,483,648 to 2,147,483,647 and cannot produce fractions or real numbers. Ring Evaluation Order A Chip that produces a signal for another chip is usually evaluated before the other chip. However, this does not work if signals travel in cycles formed by connections between chips. Rings that consist of more than one chip do not have a defined evaluation entry point. That means the chip inside the ring store that gets evaluated first cannot be defined designing the circuit. Therefore they sometimes get evaluated in an unexpected order. For example the Number Pad often produces a 0 too much at the end (i.e. the result is 10 times what it should be). If the execution order of the chips inside a ring appears wrong, it helps to exchange the chips in the ring. To do so, swap the chip that appears to be executed first with the chip that should be executed first. Then swap their functions and connections. The result is the exact same circuit, only that the chips that execute the steps are different ones. The ring should then be evaluated in the desired order. There is a solution to the ring evaluation order problem, if you would like it to be implemented, vote on this canny post. Understanding of REO is still developing. Here are some notes from experiments done by _seb: So here is something fun: Cloning can destroy your circuit order. (: Been playing around with the circuit order a bit, since it is still one of those dark mysteries. What I now believe is that the order is not saved on the chips, but rather on the connections. Basically when completing a loop, the newest connection will be marked as "delayed" (and delay the signal by a tick). If there is already a "delayed" connection in the loop it will be used instead. Now the fun starts when deleting connections. When the loop is cut open, the "delayed" line in the loop will be set inactive and not delay the signal anymore, but it will secretly retain its "delayed" flag. What that means is that if another new loop is drawn and it contains that "previously-delayed" connection, the "previously-delayed" connection will be chosen over the new connection that completed the loop and become regular "delayed" again. This is very useful in some cases. In others it'll make you unconnect all your circuits to find that connection that delays your signal. I don't think that one method is necessarily better than the other here. (But I think it would be nice to know which connections are currently "delayed" - maybe a small ui indicator on the line?). Anyways the problem now is that after cloning, those "inactive-delayed" lines can become "delayed" again, resulting in loop-free circuits with delays. These broken delayed lines will persist also across saves/restores. Could be useful as long as it stays a feature, but until then I wouldn't trust clonging. ;) Speaking of loops, here is more evidence for the "delayed-line theory": State machine state outputs don't work, if they are connected with a "delayed" line. I think @syntael had an issue with state machines not activating a while ago. Maybe this was the cause of it? First off, the whole State Machine seems to be a single node in a loop. So if you have a line going from "State 3" > "Adder" > "TRANSITIONS", you are effectively forming a loop "State Machine" > "Adder" > "State Machine". This means either the connection "State 3" > "Adder" or the connection "Adder" "TRANSITION" has to be delayed. Now this is easy to control: The last drawn connection in the loop is delayed, or a previously delayed line in the loop is made delayed again. (The state machine here serves no purpose other than to form a loop and to generate an OnEnter event.) Now if you make the line "State 3" > "Adder" delayed, you will see that the output connected to the Adder will never fire, while the output connected directly to the OnEnter pin fires as intended. This would also explain why you can't connect an OnEnter pin to a following transition anymore (I am sure this worked previously; the state machine now gets stuck in the state). Since this line forms a loop on the state machine itself, it has to be delayed and thus is broken by this bug. Authority Player Circuits (among other things) are evaluated not on any RR server, but on the client of the player who enters a room first; that player is called authority player. When the authority player leaves, another player becomes the new authority player. The client of the authority player publishes circuit results to other players in the room. This causes extreme lag (in the order of full seconds), if other players than the authority player cause circuit evaluations (by triggering zones or buttons, shooting people, etc.). In addition to that, the implementation of the authority player functionality has always been buggy and still causes synchronization problems between clients. As a result, the game state observed by the authority player and the state observed by anyone else often do not match, the world might even change when a new authority player is chosen (sandbox radios for example start playing again). Global Chip Update Tick Changes: * Rec Royale Alpha Update: The random number generator chip is not affected anymore. The effect can still be observed with the new player stat and team change chips. * Pizza & Potions Update: No change. * Locomotion Update: No change. * Isle of Lost Skulls Update: Currently this issue only affects random number generator chips. The first example on the right demonstrates the issue. Note that the button is not connected to anything at all. Every time the button gets pressed, the output increases by 2. All Chips in one room are evaluated every time any chip gets evaluated (about 10 times per second); otherwise they are usually not evaluated. The result may be confusing and counterintuitive - in particular if you rely on this "lazy" evaluation. For example a ring store that has an external input signal usually does not change until a signal is triggered. However, it does change when an unrelated signal in an unrelated circuit in the same room gets triggered. If you encounter values that appear to be changing randomly while building a circuit or when triggering signals at the other end of the room, this is probably the reason. The simplest way to reproduce this issue is to build an alternating circuit, for example by connecting the output of a Not chip to its input and observing the output. Currently there is no known workaround for this issue, other than designing the circuits in a way that they are not affected by it. (For an example, see the two variants of the Copy Value circuit: the first one is not affected by the issue but takes one more tick to perform its function.) According to Against Gravity, this issue is not a bug but an expected behavior. However, they understand that it is confusing and are considering to change the expectation. To help you building circuits in a way that they are not affected by the global update, you can add the circuit on the right to your room during construction. It will constantly induce chip updates (about 10 per second), so you will notice problems in your design early. Gizmo Rotation Compression When the length of a connection between an object and a Gizmo is very long (on the order of hundreds of meters), the connected object may appear to non-authority players a few meters out of place (radially from the center point of the Gizmo). The reason this happens is because the Authority Player sends position and rotation information about objects to non-Authority players with less-than-perfect accuracy (because the data is compressed when transmitted). For most objects this is negligible, but because the position of objects attached to a Gizmo depends completely on the orientation of the Gizmo, a small error in rotation multiplied by a very long connection radius will result in a large error in position. Similarly, if the attached object itself is very large, an error in its rotation will appear significant. Gadgets Most elements of circuits are listed in the "Gadgets" tab of the Palette. Chips See Chips. Gizmos See Gizmos. Other Gadgets Radio There are two radios: the radio and the ambience radio. When the red input arrow receives a true value, the radio starts or stops. Bugs: '''Currently it is a bad idea to control the radio by circuits for rooms that allow more than 1 player. The state of the radio (playing/stopped) is purely client based and will always start in the playing state for a player when he enters a room. If the actual/supposed state is stopped, the radio status will always appear reversed to the player. Another problem appears when a client misses the chip tick that is supposed to change the radio's state, then that client's radio will be out of sync, too. Additionally a stopped radio will start playing again if the player that has been in the room the longest leaves. The songs available to you on each radio are: Emitter The emitter creates an animated particle system. * Various particle systems can be set with the Configure mode of the Maker Pen (Confetti, Boost, Explosion, Fireflies, Firework, Fog, Hit 1, Hit 2, Leaves, Flash, Wind). * If the cyan input pin receives a value unequal to 0, new particles are emitted. If it receives 0, no new particles are emitted (unless the "Looping" setting is checked). * If "Looping" is checked, the particle system emits particles even if the cyan input pin is not connected. If it is checked and the cyan input pin is connected, then the particle system starts (and continues) as soon as a value unequal to 0 is received. * The signal on the purple input pin determines the color of some particle systems. * If "Use Maker Pen Custom Colors?" is checked and no signal is received by the purple pin, the Recolor model of the Maker Pen can be used on the emitter to set the color of some particle systems. * The signal on the yellow pin determines the size of the particle system (typical values are between -10 and 100, but some effects also allow larger values. * The signal on the blue pin determines the speed of the particles (typical values are between -10 and 100). Object Respawner An object respawner can teleport objects from anywhere in a room to the position of the object respawner. Send an object ID from a Trigger Volume that tracks objects to the red input ("Respawn Object by ID") to respawn that object. Send any signal unequal to 0 to the green input ("Respawn Object by Tag") to respawn one of the objects with the tag that is specified for the object respawner with the Configure mode of the Maker Pen. If more than one object has the tag to be respawned, the respawner chooses the tagged object farthest away from it. If "Respawn item politely?" is checked in the settings, then objects that are held by players will not respawn. If "Clear velocity on respawn?" is checked, then the object will always rest at the position of the object respawner after respawning. Point Light The Point Light is a light that shines in all directions, similar to a light bulb. You can recolour the Point Light using the Recolour Tool of the Maker Pen, change its range and intensity with the Configure Tool of the Maker Pen. You can do all of the above, as well as turn the light on and off, with Circuits. Respawn Point When a player ID is passed to the green input arrow, the player with that ID is respawned at the point. The red input arrow sets which team the respawn point belongs to, so that you can actively change it in a game. There are 16 teams and the team colors repeat after 10. -1 (or any other negative value) is any team, 1 is blue, 2 is red, 3 is orange etc. By default the spawn point is set to any team. The spawn point's team can also be set with the Configure mode of the Maker Pen for teams 1-16 and any team. If an object tag is specified for the primary or secondary hand, then the player is equipped with an item that has this tag if one is available. If "Respawn this item politely?" is checked then an item that is held by another player is not considered to be available. Sampler Samplers can play recorded audio clips of up to 30 seconds. Red input: "Play on Signal"; green input: "Playback Speed"; blue input: "Volume (Max 10)". The default volume when unconnected, or outside the range of 1-10, is 10. The playback speed specifies a factor relative to the recording speed. The factor is 1 if g = 0, otherwise the factor is g/10. The range of g is from -500 to 500. Spotlight The Spotlight is a light that shines light in a circle, similar to a flashlight. As well as having the same configuration/controlling options as the Point Light, the Spotlight’s angle can be configured, that is the size of the circle it produces. Trigger Volume Trigger volumes are created with the Maker Pen and the Palette in a similar way as Cube shapes. They have two modes that can be set with the Configure mode of the Maker Pen: either they keep track of players or of objects. If either a player role, or an object tag is specified under "Filter By", then only players/objects with this tag are tracked. If tracking players, the red pin outputs 0, or the player ID of a player who just entered the trigger volume. The green pin outputs the number of players in the trigger volume. The blue pin outputs 0, or the player ID of a player who just exited the trigger volume. If tracking objects, the red pin outputs 0, or the object ID of the object which just entered the trigger volume. The green pin outputs the number of objects in the trigger volume. The blue pin outputs 0, or the object ID of the object that just exited the trigger volume. (To identify the player who most recently has interacted with this object, use the Object Mapper chip.) Welcome Mat The Welcome Mat cannot be connected to circuits. Dynamic Props Most of the "dynamic" props in the Palette either receive or send circuit signals if their colored pins/arrows are connected to other circuit elements. Bowling Pin The bowling pin is about the only Sports prop in the Palette that has output pins. The green pin outputs the angle from upright rotation (in degrees). The red pin outputs 1 if the pin is upright and 0 otherwise. Upright is defined any angle < 25°. Beacon The Beacon is a transparent beam/column, which can be used to highlight things - similar to the beacons in Disc Golf and Rec Royale. If the cyan input pin ("On/Off") receives 0, the beacon is deactivated. The signal on the magenta input pin ("Color") specifies the color of the column. The yellow input pin ("Beam Height") specifies the height of the beacon. Button When the button is pressed, red pin will output a tick of 1. While holding down the button, the green pin will output a consistent 1. The blue pin will output a tick of 1 when the button is released. The button can be configured to output the ID of the Player who interacted with the button, instead of a 1. Costume Dummy A Costume Dummy sends the player ID of the player who is wearing the costume on the red pin. Otherwise it sends 0. Dice When a dice rolls, the connection outputs the value of the roll momentarily. You could use a pulse to steady conversion circuit or a copy value circuit to store the dice roll result. Disc Golf Goal When a disc hits the goal, the red output arrow outputs a momentary 1. Holotar Projector When the green input arrow receives a non-zero value, the Holotar starts playback. When the red input arrow receives a non-zero value, the Holotar stops playback. Object Goal When an object passes through the goals, the red output arrow outputs a momentary 1. Player Goal When a player passes through the goal, the red output arrow outputs a momentary 1. Room Door When the red input arrow is receiving a true value (any value other than 0), the door is locked. Scoreboard Projector The scoreboard projector cannot be connected to circuits. It is controlled by the Scoreboard Setup Chip and the Game Rules Chip. '''Note: * After spawning the projector, you might have to turn it by 180 degrees to face its front and thus activate it. * If the "Start" button is missing on the scoreboard, reduce the "Team Count" of the active Game Rules chip such that all teams fit on one page of the scoreboard. Sign The sign can display one of 5 text messages that can be set with the Configure mode of the Maker Pen. The cyan input signal determines which message is displayed (0 to 4). Use "{R}", "{G}", and "{B}" in the text messages to display the value of the red, green, and blue input signals. Sign text is limited to about 19 characters. Sign text responds to Unity's rich text formatting properties. To change text color, use , replacing ###### with either the color name (e.g. red, blue) or a hexidecimal color code. To detach text from a sign, use , replacing # with either an integer or {R}, {G}, {B}. Other text formatting properties are available here for reference. Formatting text is counted towards the message character limit, so formatted text usually must be very short. To enter some text characters not appearing on the in-game keyboard (e.g. ö, ä) players may launch Screen Mode and input characters using their keyboard. Stage Light The stage light looks like a spotlight that creates a square pyramid of light originating from the source that gradually tapers off several meters away from the source. The cyan input controls the On/Off state with 0 being off and non-zero being on. The magenta input controls the color of the lamp. The yellow input controls the intensity of the lamp, with 0 being no intensity and 100 being max intensity. The light cone passes through objects, so there are no shadows. The circuit stage light is an environmental object that is not influenced by physics. UPDATE April 23 2019: "Updated Stage Light colors to match the order of other circuit-colored objects (Emitter, Lights, Beacon). This means the default color is red, and circuit signals are now assigned in the same order as other objects (0 = red, 1 = orange and so on)." Category:Tools